<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增数据源')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-db-add">
            <input id="idIndex" name="parentId" type="hidden"/>
            <div class="form-group">    
                <label class="col-sm-3 control-label">名称：</label>
                <div class="col-sm-8">
                    <input name="na" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">数据库类型：</label>
                <div class="col-sm-8">
                    <select name="sdDbtp" class="form-control m-b" th:with="type=${@baseSd.getItem('db_type')}">
                        <option th:each="item : ${type}" th:text="${item.na}" th:value="${item.cd}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">数据库分类：</label>
                <div class="col-sm-8">
                    <select name="sdBuscls" class="form-control m-b" th:with="type=${@baseSd.getItem('db_cls')}">
                        <option th:each="item : ${type}" th:text="${item.na}" th:value="${item.cd}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">数据库字符：</label>
                <div class="col-sm-8">
                    <select name="chara" class="form-control m-b">
                        <option value="UTF-8">UTF-8</option>
                        <option value="GBK">GBK</option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">驱动类：</label>
                <div class="col-sm-8">
                    <input name="driver" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">URL：</label>
                <div class="col-sm-8">
                    <input name="url" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">用户名：</label>
                <div class="col-sm-8">
                    <input name="naUse" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">密码：</label>
                <div class="col-sm-8">
                    <div class="input-group">
                        <input id="password" name="pwd" placeholder="请输入登录密码" class="form-control" type="password" required>
                        <span class="input-group-addon" title="登录密码,鼠标按下显示密码"
                              onmousedown="$('#password').attr('type','text')"
                              onmouseup="$('#password').attr('type','password')"><i class="fa fa-key"></i></span>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "base/db"
        $("#form-db-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-db-add').serialize());
            }
        }

        $("input[name='dtSysCre']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='dtSysModi']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>